#include "rio.h"

#include <stdio.h>

void 
echo(int connfd)
{
    ssize_t n;
    RIOT rio;
    char buf[10240];

    rio_readinitb(&rio, connfd);
    while ((n = rio_readlineb(&rio, buf, sizeof(buf))) > 0) {
        printf("server received %d bytes\n", (int)n);
        rio_writen(connfd, buf, n);
    }
}
